package org.xx.armory.swing.builders;

import org.xx.armory.swing.components.BorderType;

public class RulerModelBuilder
        extends ComponentModelBuilder<RulerModel> {
    private int axis;

    private BorderType type;

    public RulerModelBuilder() {
    }

    public RulerModelBuilder setAxis(
            int axis
    ) {
        this.axis = axis;
        return this;
    }

    public RulerModelBuilder setType(
            BorderType type
    ) {
        this.type = type;
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public RulerModel build() {
        BorderType type = this.type;
        if (type == null) {
            type = BorderType.NONE;
        }
        return new RulerModel(getLineInfo(), getName(), isVisible(), this.axis, this.type);
    }
}
